package com.sugon.annotation;

import org.junit.Test;

import java.lang.reflect.Method;

/**
 * @author LUOYUAN
 * @create 2018-12-08-0:08
 */
public class TestAnnotation {
    
    @MyAnnotation("hello")
    @MyAnnotation("world")
    public void show(){
    }
    
    @Test
    public void test1() throws Exception{
        Class<TestAnnotation> clazz = TestAnnotation.class;
        Method m = clazz.getMethod("show");
        MyAnnotation[] mas = m.getAnnotationsByType(MyAnnotation.class);
        for (MyAnnotation ma : mas) {
            System.out.println(ma);
        }

    }
}
